package cn.lecosa.spark

import org.apache.spark.{SparkConf, SparkContext}

object ScalaWordCount {
  def main(args: Array[String]): Unit = {
    val conf =new SparkConf().setAppName("scala word count").setMaster("local")
    val sc =new SparkContext(conf)
    sc.textFile(  args(0) )
      .flatMap(_.split(" ")).map((_,1)) .reduceByKey(_+_).saveAsTextFile(args(1))




    sc.stop()
  }
}
